﻿using System;
using WmsApp.Security;
using WmsApp.WindowControl;

namespace WmsApp.WmsService
{
    public partial class StockTackingDtl : IWcfState
    {
        public static StockTackingDtl CreateStockTackingDtl(string stockTackingNo)
        {
            var r = new StockTackingDtl
                        {
                            StockTackingDtlNo = Guid.NewGuid().ToString("N"),
                            StockTackingNo = stockTackingNo,
                            CreateTime = DateTime.Now,
                            CreateUserID = UserSession.CurrentUser.USERID,
                            CreateUserName = UserSession.CurrentUser.USERNAME,
                            WcfEntityState = System.Data.EntityState.Added
                        };
            r.BindPropertyChanged();
            return r;
        }

        public void BindPropertyChanged()
        {
            this.PropertyChanged += WmsApp.EntityControl.PropertyChangedHandler.EntityObjectPropertyChanged;
        }

        private bool _isSelected = false;

        /// <summary>
        /// 是否选择
        /// </summary>
        public bool IsSelected
        {
            get { return _isSelected; }
            set { _isSelected = value; }
        }
    }
}
